/*河南星辰软件科技有限公司
@copyright Copyright (c) 2010~2022 All rights reserved.
*/
package cn.javaxc.crm.action.sale;
import java.io.*;
import java.util.*;
import java.sql.*;
import cn.javaxc.model.base.SQL;
import cn.javaxc.model.base.SQLList;
import cn.javaxc.model.base.SQLMap;
import cn.javaxc.model.base.SQLParam;
import cn.javaxc.model.page.BatisPage;
import cn.javaxc.mvcwork.controller.web.TreeBean;
import cn.javaxc.mvcwork.util.common.CommonUtil;
import cn.javaxc.mvcwork.util.common.MapListUtil;
import cn.javaxc.mvcwork.util.helper.FrameHelper;
import cn.javaxc.mvcwork.util.helper.TreeTableHelper;
import org.springframework.beans.factory.annotation.Autowired;
import cn.javaxc.system.action.base.BaseAction;
import cn.javaxc.crm.mapper.sale.PotentialAdminMapper;
public class PotentialAdmin extends BaseAction
{
    @Autowired(required=false)
	private PotentialAdminMapper mapper;
    /**
    增加商机
    */
    
    public Map potentialBusAdd() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        SQLList<SQLMap> person=mapper.person(params);
        result.put("person", person);
        
        
        SQLList<SQLMap> client=mapper.client(params);
        result.put("client", client);
        
        
        result.put("predict", create_code(getParameter("CMID5"),"predict_barcode"));
        
        return result;
    }
    /**
    商机统计图
    */
    
    public Map cartogramBusOpportunity() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        TreeBean tb;
        
        
        
        
        
        Object CMID6 =mapper.CMID6(params);
        result.put("CMID6", CMID6);
        
        
        
        
        Object dept_id =mapper.dept_id(params);
        result.put("dept_id", dept_id);
        
        
        tb = createTreeBean("l_firm_treecols");
        tb.setPid(CMID6);
        SQLList<SQLMap> l_firm=mapper.l_firm(params);
        l_firm = l_firm.buildTree(tb,tb.getPid());
        result.put("l_firm", l_firm);
        
        
        params.def("CMID7",-1);
        params.def("CMID8",-1);
        SQLList<SQLMap> s_s=mapper.s_s(params);
        SQLMap s_s_emt=s_s.getExistfirst();
        result.put("s_s", s_s_emt);
        
        
        params.def("CMID7",-1);
        Object CMID7 =mapper.CMID7(params);
        result.put("CMID7", CMID7);
        
        
        Object CMID2 =mapper.CMID2(params);
        result.put("CMID2", CMID2);
        
        
        SQLList<SQLMap> s_person=mapper.s_person(params);
        s_person.setSelectNone("全部");
        result.put("s_person", s_person);
        
        
        params.def("CMID8",-1);
        Object CMID8 =mapper.CMID8(params);
        result.put("CMID8", CMID8);
        
        
        
        return result;
    }
    /**
    */
    
    public Object l_pret() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        SQLList<SQLMap> l_pret=mapper.l_pret(params,pagination);
        l_pret.setPagedListInfo(pagination);
        result.put("l_pret", l_pret);
        
        return l_pret;
    }
    /**
    商机明细
    */
    
    public Map busOpportunityDet() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        SQLList<SQLMap> part=mapper.part(params);
        result.put("part", part);
        
        
        SQLList<SQLMap> pret=mapper.pret(params);
        SQLMap pret_emt=pret.getExistfirst();
        result.put("pret", pret_emt);
        
        return result;
    }
    /**
    商机修改
    */
    
    public Map busOpportunityUp() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        SQLList<SQLMap> pret=mapper.pret(params);
        SQLMap pret_emt=pret.getExistfirst();
        result.put("pret", pret_emt);
        
        
        SQLList<SQLMap> person=mapper.person(params);
        result.put("person", person);
        
        
        SQLList<SQLMap> client=mapper.client(params);
        result.put("client", client);
        
        return result;
    }
    /**
    修改组件
    */
    
    public Map cartogramBusAssemblyUp() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        SQLList<SQLMap> clientorigin=mapper.clientorigin(params);
        result.put("clientorigin", clientorigin);
        
        
        SQLList<SQLMap> person=mapper.person(params);
        result.put("person", person);
        
        
        SQLList<SQLMap> part=mapper.part(params);
        SQLMap part_emt=part.getExistfirst();
        result.put("part", part_emt);
        
        return result;
    }
    /**
    组件明细
    */
    
    public Map cartogramBusAssemblyDet() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        SQLList<SQLMap> part=mapper.part(params);
        SQLMap part_emt=part.getExistfirst();
        result.put("part", part_emt);
        
        return result;
    }
    /**
    添加组件
    */
    
    public Map cartogramBusAssemblyAdd() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        SQLList<SQLMap> person=mapper.person(params);
        result.put("person", person);
        
        
        
        return result;
    }
    /**
    活动
    */
    
    public Map busOpportunityActivity() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        SQLList<SQLMap> act_ing=mapper.act_ing(params,pagination);
        act_ing.setPagedListInfo(pagination);
        result.put("act_ing", act_ing);
        
        
        SQLList<SQLMap> end_act=mapper.end_act(params,pagination);
        end_act.setPagedListInfo(pagination);
        result.put("end_act", end_act);
        
        return result;
    }
    /**
    工作记录
    */
    
    public Map busOpportunityWorkRecord() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        SQLList<SQLMap> acts=mapper.acts(params);
        SQLMap acts_emt=acts.getExistfirst();
        result.put("acts", acts_emt);
        
        
        
        return result;
    }
    /**
    增加活动
    */
    
    public Map busOpportunityWorkRecordAdd() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        SQLList<SQLMap> wype=mapper.wype(params);
        result.put("wype", wype);
        
        
        SQLList<SQLMap> state=mapper.state(params);
        result.put("state", state);
        
        
        SQLList<SQLMap> person=mapper.person(params);
        result.put("person", person);
        
        
        
        return result;
    }
    /**
    修改活动
    */
    
    public Map busOpportunityWorkRecordUp() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        SQLList<SQLMap> acts=mapper.acts(params);
        SQLMap acts_emt=acts.getExistfirst();
        result.put("acts", acts_emt);
        
        
        
        
        SQLList<SQLMap> wype=mapper.wype(params);
        result.put("wype", wype);
        
        
        SQLList<SQLMap> state=mapper.state(params);
        result.put("state", state);
        
        
        
        
        SQLList<SQLMap> person=mapper.person(params);
        result.put("person", person);
        
        return result;
    }
    /**
    明细活动
    */
    
    public Map busOpportunityWorkRecordDet() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        SQLList<SQLMap> acts=mapper.acts(params);
        SQLMap acts_emt=acts.getExistfirst();
        result.put("acts", acts_emt);
        
        return result;
    }
    /**
    记录列表
    */
    
    public Map busOpportunityActList() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        SQLList<SQLMap> redl=mapper.redl(params);
        result.put("redl", redl);
        
        
        SQLList<SQLMap> s_act=mapper.s_act(params);
        SQLMap s_act_emt=s_act.getExistfirst();
        result.put("s_act", s_act_emt);
        
        return result;
    }
    /**
    增加记录
    */
    
    public Map busOpportunityActAdd() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        
        
        SQLList<SQLMap> wype=mapper.wype(params);
        result.put("wype", wype);
        
        
        
        
        SQLList<SQLMap> person=mapper.person(params);
        result.put("person", person);
        
        
        SQLList<SQLMap> pers=mapper.pers(params);
        result.put("pers", pers);
        
        
        
        return result;
    }
    /**
    修改记录
    */
    
    public Map busOpportunityActUp() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        SQLList<SQLMap> red=mapper.red(params);
        SQLMap red_emt=red.getExistfirst();
        result.put("red", red_emt);
        
        
        
        
        SQLList<SQLMap> wype=mapper.wype(params);
        result.put("wype", wype);
        
        
        
        
        SQLList<SQLMap> person=mapper.person(params);
        result.put("person", person);
        
        
        SQLList<SQLMap> pers=mapper.pers(params);
        result.put("pers", pers);
        
        return result;
    }
    /**
    明细记录
    */
    
    public Map busOpportunityActDet() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        SQLList<SQLMap> red=mapper.red(params);
        SQLMap red_emt=red.getExistfirst();
        result.put("red", red_emt);
        
        return result;
    }
    /**
    文档
    */
    
    public Map busOpportunityFiles() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        SQLList<SQLMap> file_admin=mapper.file_admin(params);
        result.put("file_admin", file_admin);
        
        
        SQLList<SQLMap> s_deploy=mapper.s_deploy(params);
        result.put("s_deploy", s_deploy);
        
        return result;
    }
    /**
    增加文档
    */
    
    public Map busOpportunityAdd() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        result.put("file_admin", create_code(7,"file_num"));
        
        return result;
    }
    /**
    增加商机修改
    */
    
    public Map potentialBusAddSubmit() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        int CMID1 = mapper.CMID1(params);
        result.put("CMID1", CMID1);
        
        return result;
    }
    /**
    */
    
    public Map d_pret() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        mapper.d_pret(params);
        
        return result;
    }
    /**
    */
    
    public Map d_part() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        mapper.d_part(params);
        
        return result;
    }
    /**
    商机修改修改
    */
    
    public Map busOpportunityUpSubmit() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        int u_predict = mapper.u_predict(params);
        result.put("u_predict", u_predict);
        
        return result;
    }
    /**
    修改组件修改
    */
    
    public Map cartogramBusAssemblyUpSubmit() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        mapper.cartogramBusAssemblyUpSubmit(params);
        
        return result;
    }
    /**
    添加组件修改
    */
    
    public Map cartogramBusAssemblyAddSubmit() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        int i_predict_part = mapper.i_predict_part(params);
        result.put("i_predict_part", i_predict_part);
        
        
        result.put("CMID2", i_predict_part);
        
        return result;
    }
    /**
    */
    
    public Map u_act() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        mapper.u_act(params);
        
        return result;
    }
    /**
    增加活动修改
    */
    
    public Map busOpportunityWorkRecordAddSubmit() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        int CMID3 = mapper.CMID3(params);
        result.put("CMID3", CMID3);
        
        return result;
    }
    /**
    修改活动修改
    */
    
    public Map busOpportunityWorkRecordUpSubmit() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        mapper.busOpportunityWorkRecordUpSubmit(params);
        
        return result;
    }
    /**
    */
    
    public Map d_re() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        mapper.d_re(params);
        
        return result;
    }
    /**
    增加记录修改
    */
    
    public Map busOpportunityActAddSubmit() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        int i_record = mapper.i_record(params);
        result.put("i_record", i_record);
        
        
        result.put("CMID2", i_record);
        
        return result;
    }
    /**
    修改记录修改
    */
    
    public Map busOpportunityActUpSubmit() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        mapper.busOpportunityActUpSubmit(params);
        
        return result;
    }
    /**
    */
    
    public Map d_file() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        mapper.d_file(params);
        
        return result;
    }
    /**
    增加文档修改
    */
    
    public Map busOpportunityAddSubmit() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        int i_file_admin = mapper.i_file_admin(params);
        result.put("i_file_admin", i_file_admin);
        
        return result;
    }
}